package com.easou.ps.dk.utils;

import java.io.File;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;

import com.easou.ps.dk.domain.QueryParams;

public class StatusUtils {

	public static void toSaveTodayStatus(QueryParams qp) {
		String dataPath = Configer.get("data_path");
		dataPath = (dataPath.endsWith("/") ? dataPath.substring(0, dataPath.length() - 1) : dataPath);
		File todayFile = new File(dataPath + "/" + GetDay.getToday());
		if (!todayFile.exists()) {
			todayFile.mkdir();
		}
		String fileName = dataPath + "/" + GetDay.getToday() + "/qp.ser";
		// 保存二进制结果对象
		try {
			File file = new File(fileName);
			if(!file.exists()){				
				FileOutputStream fs = new FileOutputStream(fileName);
				ObjectOutputStream os = new ObjectOutputStream(fs);
				os.writeObject(qp);
				os.close();
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println("dirk");
	}
}
